<!DOCTYPE html>
<html>
<head>
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta charset="UTF-8">
    <script src="js/adapt.js"></script>
    <title></title>
    <link rel="stylesheet" href="css/style.css" type="text/css"/>
    <script src="js/jquery.js"></script>
    <script src="js/jquery.lazyload-1.9.5.min.js"></script>
    <script src="js/global.js"></script>
</head>
<body>
<div class="head">
    <a class="btn back" href="cart.html"></a><div>购物车</div><a class="txt_btn" href="cart.html">完成</a>
</div>
<div class="placeholder"></div>
<div class="left_right">
    <table class="cart_list">
        <tr>
            <td class="cart_pic">
                <div class="img_con">
                    <a href="productD.html?up=cart"><img src="uploads/cart1.png"/></a>
                </div>
            </td>
            <td>
                <input type="checkbox" name="ckb1" id="ckb1" class="checkbox"/><label for="ckb1" class="check1"></label>
                <div class="cart_info">
                    <p class="cart_name">多彩高帮休闲鞋</p>
                    <div class="cart_norms">
                        <dl>
                            <dd>颜色：</dd>
                            <dd><span class="cart_color"><img src="uploads/color.png"/></span></dd>
                            <dd>尺码：36</dd>
                        </dl>
                        <div>数量：<span class="num">1</span></div>
                    </div>
                    <div class="num_adjust"><a class="adjust">-</a><a class="num">1</a><a class="adjust">+</a></div>
                </div>
            </td>
        </tr>
        <tr>
            <td class="cart_pic">
                <div class="img_con">
                    <a href="productD.html?up=cart"><img data-url="uploads/cart2.png"/></a>
                </div>
            </td>
            <td>
                <input type="checkbox" name="ckb2" id="ckb2" class="checkbox"/><label for="ckb2" class="check1"></label>
                <div class="cart_info">
                    <p class="cart_name">水晶蓝凉鞋</p>
                    <div class="cart_norms">
                        <dl>
                            <dd>颜色：</dd>
                            <dd><span class="cart_color"><img  data-url="uploads/color.png"/></span></dd>
                            <dd>尺码：37</dd>
                        </dl>
                        <div>数量：<span class="num">2</span></div>
                    </div>
                    <div class="num_adjust"><a class="adjust">-</a><a class="num">2</a><a class="adjust">+</a></div>
                </div>
            </td>
        </tr>
        <tr>
            <td class="cart_pic">
                <div class="img_con">
                    <a href="productD.html?up=cart"><img data-url="uploads/cart3.png"/></a>
                </div>
            </td>
            <td>
                <input type="checkbox" name="ckb1" id="ckb3" class="checkbox"/><label for="ckb3" class="check1"></label>
                <div class="cart_info">
                    <p class="cart_name">水晶蓝凉鞋</p>
                    <div class="cart_norms">
                        <dl>
                            <dd>颜色：</dd>
                            <dd><span class="cart_color"><img  data-url="uploads/color.png"/></span></dd>
                            <dd>尺码：37</dd>
                        </dl>
                        <div>数量：0</div>
                    </div>
                    <p class="sold_out">已下架</p>
                </div>
            </td>
        </tr>
    </table>
</div>
<div class="placeholder"></div>
<div class="foot_menu black_bg">
    <a class="width_auto_btn">加入我的收藏</a><a class="width_auto_btn" href="cart.html">删除</a><input type="checkbox" class="checkbox1" name="ckbAll" id="ckbAll"/><label for="ckbAll" class="check2">全选</label>
</div>
<script>
    $(function(){
        $(".adjust").click(function(){
            var t = $(this),
                 va1 = t.next().text(),
                 va2 = t.prev().text(),
                 mod = t.parents(".cart_info").find(".num");
            if(va1>0&&va1){
                mod.text(va1-1);
            }
            if(va2){
                mod.text(va2-1+2);
            }
        });

        var cart_list = $(".cart_list"),
             cart_check = cart_list.find(":checkbox"),
             ckb_all = $("#ckbAll");

        cart_check.change(function(){
            if($(this).is(":checked")){
                var all = cart_list.find(":checkbox:checked").length===cart_check.length;
                if(all){
                    ckb_all.attr("checked","checked");
                }
            }else{
                ckb_all.removeAttr("checked");
            }
        });

        ckb_all.change(function(){
           if($(this).is(":checked")){
               cart_check.attr("checked","checked");
           }else{
               cart_check.removeAttr("checked");
           }
        });
    });
</script>
</body>
</html>